package com.pai4j.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 创作者状态枚举
 *
 * @author: CYM-pai
 * @date: 2025/11/01
 */
@Getter
@AllArgsConstructor
public enum CreatorStatusEnum {
    
    PENDING(0, "待审核"),
    APPROVED(1, "已通过"),
    REJECTED(2, "已拒绝"),
    DISABLED(3, "已禁用");
    
    private final Integer code;
    private final String desc;
    
    /**
     * 根据code获取枚举
     */
    public static CreatorStatusEnum getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (CreatorStatusEnum statusEnum : CreatorStatusEnum.values()) {
            if (statusEnum.getCode().equals(code)) {
                return statusEnum;
            }
        }
        return null;
    }
}




